﻿/// <reference path="../jquery-1.2.6.js" />
$(
function() {
    var screenHeight = document.body.scrollHeight < 500 ? window.screen.availHeight - 140 : document.body.scrollHeight;
    var screenWidth = window.screen.availWidth;
    var bodyWidth = document.body.clientWidth - 30;
    var topWidth, middleWidth, bottomWidth, middleLeftWidth, middleRightWidth, topHeight, bottomHeight, middleHeight;
    $(document.body).height(screenHeight); //手动指定body高度，以兼容不同浏览器

    topWidth = middleWidth = bottomWidth = screenWidth;
    middleLeftWidth = 250;
    middleRightWidth = middleWidth - middleLeftWidth;
    topHeight = 100;
    bottomHeight = 50;
    middleHeight = screenHeight - topHeight - bottomHeight;

    $("#top").css({ "background-color": "red", "width": topWidth, "height": topHeight, "position": "absolute", "left": 0, "top": 0, "zIndex": 1 });
    $("#middle_left").css({ "background-color": "yellow", "width": middleLeftWidth, "height": middleHeight, "position": "absolute", "left": 0, "top": topHeight, "zIndex": 1 });
    $("#middle_right").css({ "background-color": "green", "width": middleRightWidth, "height": middleHeight, "position": "absolute", "left": middleLeftWidth, "top": topHeight, "zIndex": 1 });
    $("#bottom").css({ "width": middleWidth, "height": bottomHeight, "background-color": "red", "position": "absolute", "top": topHeight + middleHeight, "left": 0, "zIndex": 1 });

    var i = new IM.Control.SideBar({
        Render: $("#middle_left"),
        Direction: "left",
        CollapsedCallBack: function() { $("#middle_right").css({ "width": middleRightWidth + middleLeftWidth - 20, "position": "absolute", "left": 20 }); },
        OnExpandCallBack: function() { $("#middle_right").css({ "position": "absolute", "left": 20 }); },
        OnCollapseCallBack: function() { $("#middle_right").css({ "width": middleRightWidth + middleLeftWidth - 20, "position": "absolute", "left": 20 }); },
        ExpandedCallBack: function() { $("#middle_right").css({ "width": middleRightWidth, "position": "absolute", "left": middleLeftWidth }); }

    });


    //    var s = "网页可见区域宽：" + document.body.clientWidth;
    //    s += "\r\n网页可见区域高：" + document.body.clientHeight;
    //    s += "\r\n网页正文全文宽：" + document.body.scrollWidth;
    //    s += "\r\n网页正文全文高：" + document.body.scrollHeight;
    //    s += "\r\n网页正文部分上：" + window.screenTop;
    //    s += "\r\n网页正文部分左：" + window.screenLeft;
    //    s += "\r\n屏幕分辨率的高：" + window.screen.height;
    //    s += "\r\n屏幕分辨率的宽：" + window.screen.width;
    //    s += "\r\n屏幕可用工作区高度：" + window.screen.availHeight;
    //    s += "\r\n屏幕可用工作区宽度：" + window.screen.availWidth;
    //    //alert(s);


}
);